//
//  TMGHelpTableViewCell.m
//  TMGold
//
//  Created by Mac on 2017/12/11.
//  Copyright © 2017年 tangmu. All rights reserved.
//

#import "TMGHelpTableViewCell.h"
@interface  TMGHelpTableViewCell()
@property(nonatomic, strong) STLabel                     *titleLable;
@property(nonatomic, strong) STLabel                     *desLable;

@end

@implementation TMGHelpTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 70;
}
#pragma mark --subView
- (void)configSubView{
    self.clipsToBounds = YES;
    self.titleLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 15, 300, 17)
                                               text:@"卖金"
                                          textColor:TM_firstTextColor
                                               font:15
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    self.titleLable.centerY = 22;
    [self addSubview:self.titleLable];
    
    self.showButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)
                                                     title:nil
                                                titleColor:nil
                                                 titleFont:0
                                              cornerRadius:0
                                           backgroundColor:nil
                                           backgroundImage:nil
                                                     image:[UIImage imageNamed:@"01"]];
    self.showButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [self.showButton setImage:[UIImage imageNamed:@"02"] forState:UIControlStateSelected];
    self.showButton.right = UIScreenWidth - 15;
    [self addSubview:self.showButton];
    
    UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, 43, UIScreenWidth, 0.5)];
    line.backgroundColor = TM_lineColor;
    [self addSubview:line];
    self.desLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 15 + 44, UIScreenWidth - 30, 15)
                                               text:@"2017-12-11 09:42:08"
                                          textColor:TM_secendTextColor
                                               font:14
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    self.desLable.numberOfLines = 0;
    [self addSubview:self.desLable];
    
    
    
}
- (void)setModel:(TMGHelpModel *)model{
    _model = model;
    self.titleLable.text = model.questions;
    self.showButton.selected = model.isSelected;
    self.desLable.text = model.anwsers;
    [NSString lableAutoAdjustheightWithLabel:self.desLable];
    model.cellHeight = self.desLable.bottom + 15;
}
@end
